<?php


namespace app\admin1\validate;


use think\Validate;

class GoodsValidate extends Validate
{
    //定义验证规则
    protected $rule = [
        'price' =>'require',
        'image' => 'require',//|unique:user
        'type' => 'require',
        'status' => 'require',

    ];
    //定义验证失败时的提示信息
    protected $message = [
        'price.require' => '产品名为必填',
        'image.require' => '图片为必填',
        'type.require' => '营销类型为必填',
        'status.require' => '销售状态为必填',

    ];

    //验证场景
    protected  $scene = [
        'add' => ['price','image','type','status'],
        'edit' => ['price','image'],
    ];
}